//
//  DSNetworkTool.h
//  DSJY
//
//  Created by XCY
//  Copyright (c) 2016年 HQ. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

@class DSAccount, DSMyLearnInfo;
@interface DSNetworkTool : NSObject

#pragma mark - 接口实现
+ (void)GET:(NSString *)url dismiss:(BOOL)dismiss params:(NSDictionary *)params success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

+ (void)POST:(NSString *)url params:(NSDictionary *)params success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

+ (void)POST:(NSString *)url params:(id)params constructingBodyWithBlock:(void (^)(id<AFMultipartFormData> formData))constructingBodyWithBlock progress:(void (^)(NSProgress *uploadProgress))progress success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

+ (void)POSTJson:(NSString *)url params:(id)params success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

#pragma mark - 各个模块的接口
//游客登录
+ (void)visitorsLoginWithSuccess:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//登录
+ (void)loginWithParams:(DSAccount *)account success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//注册
+ (void)regisgerWithParams:(DSAccount *)account success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//学习记录
+ (void)learnInfoListWithParams:(DSAccount *)account pagenum:(NSInteger)pagenum pagecount:(NSInteger)pagecount success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//今日排行榜
+ (void)toDayHeroesListWithParams:(DSAccount *)account pagenum:(NSInteger)pagenum pagecount:(NSInteger)pagecount success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//本月排行榜
+ (void)monthHeroesListWithParams:(DSAccount *)account pagenum:(NSInteger)pagenum pagecount:(NSInteger)pagecount success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//首页加载课程
+ (void)indexWithParams:(DSAccount *)account pagenum:(NSInteger)pagenum pagecount:(NSInteger)pagecount success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//单元列表
+ (void)learnListWithParams:(DSAccount *)account bookid:(NSString *)bookid pagenum:(NSInteger)pagenum pagecount:(NSInteger)pagecount success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//下载
+ (void)downFileWithUrlString:(NSString *)urlString unitId:(NSString *)unitId success:(void (^)(NSString *urlString))success failure:(void (^)(NSError *error))failure;

//下载
+ (void)downFileWithUrlString:(NSString *)urlString unitId:(NSString *)unitId index:(NSString *)index success:(void (^)(NSString *urlString))success failure:(void (^)(NSError *error))failure;

//oss文件下载
+ (void)ossDownFileWithPath:(NSString *)path unitId:(NSString *)unitId success:(void (^)(NSString *urlString))success failure:(void (^)(NSError *error))failure;

//点击单元进行学习接口
+ (void)learnCourseWithParams:(DSAccount *)account unitid:(NSString *)unitid userExist:(BOOL)userExist success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//添加学习记录接口
+ (void)insertMyLearninginfoWithParams:(DSMyLearnInfo *)myLearnInfo success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//支付接口
+ (void)orderPayWithParams:(DSAccount *)account year:(NSString *)year channel:(NSString *)channel success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//获取订单列表
+ (void)studentOrderListWithParams:(DSAccount *)account channel:(NSString *)channel success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//iap验证及返回的数据
+ (void)iapWithParams:(DSAccount *)account year:(NSString *)year channel:(NSString *)channel receipt:(NSString *)receipt chooseEnv:(BOOL)chooseEnv success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//获取iap的列表
+ (void)getIapProductsWithSuccess:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

//更新是否分享排行榜显示
+ (void)updateSharescoreWithParams:(DSAccount *)account sharescore:(NSString *)sharescore success:(void (^)(NSDictionary *responseObject))success failure:(void (^)(NSError *error))failure;

@end
